﻿Imports Microsoft.VisualStudio.TestTools.UnitTesting
Imports RMCharGen.Tables

'''<summary>
'''This is a test class for StatGainTest and is intended
'''to contain all StatGainTest Unit Tests
'''</summary>
<TestClass()> _
Public Class StatGainTest


    Private testContextInstance As TestContext

    '''<summary>
    '''Gets or sets the test context which provides
    '''information about and functionality for the current test run.
    '''</summary>
    Public Property TestContext() As TestContext
        Get
            Return testContextInstance
        End Get
        Set(ByVal value As TestContext)
            testContextInstance = Value
        End Set
    End Property

#Region "Additional test attributes"
    '
    'You can use the following additional attributes as you write your tests:
    '
    'Use ClassInitialize to run code before running the first test in the class
    '<ClassInitialize()>  _
    'Public Shared Sub MyClassInitialize(ByVal testContext As TestContext)
    'End Sub
    '
    'Use ClassCleanup to run code after all tests in a class have run
    '<ClassCleanup()>  _
    'Public Shared Sub MyClassCleanup()
    'End Sub
    '
    'Use TestInitialize to run code before running each test
    '<TestInitialize()>  _
    'Public Sub MyTestInitialize()
    'End Sub
    '
    'Use TestCleanup to run code after each test has run
    '<TestCleanup()>  _
    'Public Sub MyTestCleanup()
    'End Sub
    '
#End Region


    '''<summary>
    '''A test for GetGain
    '''</summary>
    <TestMethod(), _
     DeploymentItem("RMCharGen.exe")> _
    Public Sub GetGainTest()
        Dim target As StatGain_Accessor = New StatGain_Accessor(45, 67)
        Dim roll As Integer = 74
        Dim expected As Integer = 12
        Dim actual As Integer
        actual = target.GetGain(roll)
        Assert.AreEqual(expected, actual, "Gain")
    End Sub

    '''<summary>
    '''A test for GetGain
    '''</summary>
    <TestMethod(), _
     DeploymentItem("RMCharGen.exe")> _
    Public Sub GetGainTest2()
        Dim target As StatGain_Accessor = New StatGain_Accessor(45, 67)
        Dim roll As Integer = 76
        Dim expected As Integer = 13
        Dim actual As Integer
        actual = target.GetGain(roll)
        Assert.AreEqual(expected, actual, "Gain")
    End Sub

    '''<summary>
    '''A test for GetGain
    '''</summary>
    <TestMethod(), _
     DeploymentItem("RMCharGen.exe")> _
    Public Sub GetGainTest3()
        Dim target As StatGain_Accessor = New StatGain_Accessor(61, 67)
        Dim roll As Integer = 2
        Dim expected As Integer = -4
        Dim actual As Integer
        actual = target.GetGain(roll)
        Assert.AreEqual(expected, actual, "Gain")
    End Sub

    '''<summary>
    '''A test for GetGain
    '''</summary>
    <TestMethod(), _
     DeploymentItem("RMCharGen.exe")> _
    Public Sub GetGainTest4()
        Dim target As StatGain_Accessor = New StatGain_Accessor(67, 67)
        Dim roll As Integer = 89
        Dim expected As Integer = 0
        Dim actual As Integer
        actual = target.GetGain(roll)
        Assert.AreEqual(expected, actual, "Gain")
    End Sub

    '''<summary>
    '''A test for GetGain
    '''</summary>
    <TestMethod(), _
     DeploymentItem("RMCharGen.exe")> _
    Public Sub GetGainTest5()
        Dim target As StatGain_Accessor = New StatGain_Accessor(61, 67)
        Dim roll As Integer = 6
        Dim expected As Integer = 0
        Dim actual As Integer
        actual = target.GetGain(roll)
        Assert.AreEqual(expected, actual, "Gain")
    End Sub

    '''<summary>
    '''A test for GetGain
    '''</summary>
    <TestMethod(), _
     DeploymentItem("RMCharGen.exe")> _
    Public Sub GetGainTest6()
        Dim target As StatGain_Accessor = New StatGain_Accessor(67, 67)
        Dim roll As Integer = 1
        Dim expected As Integer = -2
        Dim actual As Integer
        actual = target.GetGain(roll)
        Assert.AreEqual(expected, actual, "Gain")
    End Sub

    '''<summary>
    '''A test for DetermineRow
    '''</summary>
    <TestMethod(), _
     DeploymentItem("RMCharGen.exe")> _
    Public Sub DetermineRowTest()

        'Dim target As StatGain_Accessor = New StatGain_Accessor(98, 100)
        Dim expected As Integer = 20
        Dim actual As Integer
        actual = StatGain_Accessor.DetermineRow(100)
        Assert.AreEqual(expected, actual, "Row")

    End Sub

    '''<summary>
    '''A test for DetermineRow
    '''</summary>
    <TestMethod(), _
     DeploymentItem("RMCharGen.exe")> _
    Public Sub DetermineRowTest2()

        'Dim target As StatGain_Accessor = New StatGain_Accessor(26, 85)
        Dim expected As Integer = 0
        Dim actual As Integer
        actual = StatGain_Accessor.DetermineRow(-5)
        Assert.AreEqual(expected, actual, "Row")

    End Sub

    '''<summary>
    '''A test for DetermineRow
    '''</summary>
    <TestMethod(), _
     DeploymentItem("RMCharGen.exe")> _
    Public Sub DetermineRowTest3()

        'Dim target As StatGain_Accessor = New StatGain_Accessor(67, 100)
        Dim expected As Integer = 0
        Dim actual As Integer
        actual = StatGain_Accessor.DetermineRow(2)
        Assert.AreEqual(expected, actual, "Row")

    End Sub

    '''<summary>
    '''A test for DetermineRow
    '''</summary>
    <TestMethod(), _
     DeploymentItem("RMCharGen.exe")> _
    Public Sub DetermineRowTest4()

        'Dim target As StatGain_Accessor = New StatGain_Accessor(56, 100)
        Dim expected As Integer = 6
        Dim actual As Integer
        actual = StatGain_Accessor.DetermineRow(31)
        Assert.AreEqual(expected, actual, "Row")

    End Sub

    '''<summary>
    '''A test for DetermineColumn
    '''</summary>
    <TestMethod(), _
     DeploymentItem("RMCharGen.exe")> _
    Public Sub DetermineColumnTest()
        Dim target As StatGain_Accessor = New StatGain_Accessor(45, 90)
        Dim expected As Integer = 9
        Dim actual As Integer
        actual = target.DetermineColumn
        Assert.AreEqual(expected, actual, "Column")
    End Sub

    '''<summary>
    '''A test for DetermineColumn
    '''</summary>
    <TestMethod(), _
     DeploymentItem("RMCharGen.exe")> _
    Public Sub DetermineColumnTest2()
        Dim target As StatGain_Accessor = New StatGain_Accessor(100, 100)
        Dim expected As Integer = 0
        Dim actual As Integer
        actual = target.DetermineColumn
        Assert.AreEqual(expected, actual, "Column")
    End Sub

    '''<summary>
    '''A test for DetermineColumn
    '''</summary>
    <TestMethod(), _
     DeploymentItem("RMCharGen.exe")> _
    Public Sub DetermineColumnTest3()
        Dim target As StatGain_Accessor = New StatGain_Accessor(67, 73)
        Dim expected As Integer = 5
        Dim actual As Integer
        actual = target.DetermineColumn
        Assert.AreEqual(expected, actual, "Column")
    End Sub


    '''<summary>
    '''A test for StatGain Constructor
    '''</summary>
    <TestMethod(), _
     DeploymentItem("RMCharGen.exe")> _
    Public Sub StatGainConstructorTest()
        Dim current As Integer = 87
        Dim potential As Integer = 90
        Dim target As StatGain_Accessor = New StatGain_Accessor(current, potential)
        Assert.AreEqual(current, target._current, "Current")
        Assert.AreEqual(potential, target._potential, "Potential")
        Assert.AreEqual(3, target._column, "Column")
    End Sub
End Class
